const userToken = 'token'//token
const refreshToken = 'refresh_token'
const InfoKey = 'userinfo'
const userLatitude = 'latitude'
const userLongitude = 'longitude'
const userRoles = 'userRoles'
const kefuList = 'kefuList'
const UserPhone = 'UserPhone'
const paymentType = 'paymentType'
const role = 'role'
//存取token到本地--->本地缓存
export function getToken() {
  return wx.getStorageSync(userToken)
}

export function setToken(token) {
  try {
    return wx.setStorageSync(userToken, token)
  } catch (e) {
    return this.setstorage(userToken, token)
  }
}
export function removeToken() {
  return wx.removeStorageSync(userToken)
}

//存取refresh_token到本地--->本地缓存
export function getRefreshToken() {
  return wx.getStorageSync(refreshToken)
}

export function setRefreshToken(token) {
  try {
    return wx.setStorageSync(refreshToken, token)
  } catch (e) {
    return this.setstorage(refreshToken, token)
  }
}
export function removeRefreshToken() {
  return wx.removeStorageSync(refreshToken)
}



//存取个人信息到本地--->本地缓存
export function getusrInfo() {
  return wx.getStorageSync(InfoKey)
}

export function setusrInfo(info) {
  try {
    return wx.setStorageSync(InfoKey, info)
  } catch (e) {
    return this.setstorage(InfoKey, info)
  }
}
export function removeusrInfo() {
  return wx.removeStorageSync(InfoKey)
}

//存取纬度到本地--->本地缓存
export function getLatitude() {
  return wx.getStorageSync(userLatitude)
}

export function setLatitude(token) {
  try {
    return wx.setStorageSync(userLatitude, token)
  } catch (e) {
    return this.setstorage(userLatitude, token)
  }
}
export function removeLatitude() {
  return wx.removeStorageSync(userLatitude)
}

//存取经度到本地--->本地缓存
export function getLongitude() {
  return wx.getStorageSync(userLongitude)
}

export function setLongitude(token) {
  try {
    return wx.setStorageSync(userLongitude, token)
  } catch (e) {
    return this.setstorage(userLongitude, token)
  }
}
export function removeLongitude() {
  return wx.removeStorageSync(userLatitude)
}

//存用户角色
export function getRoles() {
  return wx.getStorageSync(userRoles)
}

export function setRoles(token) {
  try {
    return wx.setStorageSync(userRoles, token)
  } catch (e) {
    return this.setstorage(userRoles, token)
  }
}
export function removeRoles() {
  return wx.removeStorageSync(userRoles)
}

//客服列表
export function getKefu() {
  return wx.getStorageSync(kefuList)
}

export function setKefu(kefu) {
  try {
    return wx.setStorageSync(kefuList, kefu)
  } catch (e) {
    return this.setstorage(kefuList, kefu)
  }
}
export function removeKefu() {
  return wx.removeStorageSync(kefuList)
}

//手机号
export function getUserPhone() {
  return wx.getStorageSync(UserPhone)
}

export function setUserPhone(phone) {
  try {
    return wx.setStorageSync(UserPhone, phone)
  } catch (e) {
    return this.setstorage(UserPhone, phone)
  }
}
export function removeUserPhone() {
  return wx.removeStorageSync(UserPhone)
}

//店铺类型--->本地缓存
export function getType() {
  return wx.getStorageSync(paymentType)
}

export function setType(type) {
  try {
    return wx.setStorageSync(paymentType, type)
  } catch (e) {
    return this.setstorage(paymentType, type)
  }
}
export function removeType() {
  return wx.removeStorageSync(paymentType)
}

//是否打扫--->本地缓存
export function getRole() {
  return wx.getStorageSync(role)
}

export function setRole(type) {
  try {
    return wx.setStorageSync(role, type)
  } catch (e) {
    return this.setstorage(role, type)
  }
}
export function removeRole() {
  return wx.removeStorageSync(role)
}